<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>商品管理</title>
	<meta name="decorator" content="default"/>

	<script type="text/javascript" src="${ctxScript}/app/goods2.js"></script>


	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>

	<form:form id="searchForm" modelAttribute="goods2" action="${ctx}/app/goods2/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>商品名称：</label>
				<form:input path="name" htmlEscape="false" maxlength="80" class="input-medium"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>

			<li class="btns">

				<input id="btnAdd" class="btn btn-yellow" style="background: #ffc266!important;" type="button" value="查看详情" onclick="viewDetail('')"/>

			</li>

			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>商品名称</th>
				<th>更新时间</th>
				<th>备注信息</th>
				<shiro:hasPermission name="app:goods2:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="goods2">
			<tr>
				<td><a href="${ctx}/app/goods2/form?id=${goods2.id}">
					${goods2.name}
				</a></td>
				<td>
					<fmt:formatDate value="${goods2.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${goods2.remarks}
				</td>
				<shiro:hasPermission name="app:goods2:edit"><td>

					<a href="javascript:saveOrder('${goods.id}');">去下单</a>

					<a href="javascript:addCart('${goods.price}','${goods.name}');">加入购物车</a>

					<a href="javascript:void(0);" onclick="viewDetail('${goods.id}')">查看详情</a>

				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>